<%@ page language="java" errorPage="/error.jsp" contentType="text/html; charset=utf-8"%>
<meta charset='utf-8'>
<%@ include file="taglib.jsp" %>
<html>
<head>
    <title>ADD student</title>
</head>
<body>
<div class="img">
    <a href="/productshop" align="center">
        <img src='<c:url value = "/image/base/back_black.png"/>' width="65" alt="back" title="back"/>
    </a>
</div>

<form method ="post">
    <table align="center" width="40%">
        <input type="hidden" name = "id" value="${gpa.id}">
        <tr>
            <td colspan="2" align="center"><h1>Add gpa</h1></td>
        </tr>
        <tr>
            <td>Student:</td>
            <td><select name="student">
                <c:forEach var="item" items="${studentList}">
                    <option value="${item.id}"
                            <c:if test="${gpa.student.id == item.id}">
                                selected
                            </c:if>
                            >${item.name}</option>
                </c:forEach>
            </select></td>
        </tr>
        <tr>
            <td>Lecturer:</td>
            <td><select name="lecturer">
                <c:forEach var="item" items="${lecturerList}">
                    <option value="${item.id}"
                    <c:if test="${gpa.lecturer.id == item.id}">
                        selected
                    </c:if>
                    >${item.name}</option>
                </c:forEach>
            </select></td>
        </tr>
        <tr>
            <td>Subject:</td>
            <td><select name="subject">
                <c:forEach var="item" items="${subjectList}">
                    <option value="${item.id}"
                            <c:if test="${gpa.subject.id == item.id}">
                                selected
                            </c:if>
                            >${item.name}</option>
                </c:forEach>
            </select></td>
        </tr>
        <tr>
            <td>Grade(Средний балл)</td>
            <td><input type="text" name = "gpa" value="${gpa.gpa}"></td>
        </tr>

        <tr>
            <td colspan="2" align="center">
                <input type="submit" value="SAVE">
            </td>
        </tr>
    </table>
</form>



</body>
</html>